package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/customer/orders/project")
@Api(tags = " 服务项接口")
public class CustomerOrderController extends BaseController {

    @Autowired
    NursingProjectService nursingProjectService;
    @ApiOperation("分页查询护理项目")
    @GetMapping("/page")
    public ResponseResult<PageResponse<NursingProjectVo>> pagequery(
            @ApiParam("项目名称")
            String name,
            @ApiParam("当前页码")
            Integer pageNum,
            @ApiParam("页码总数")
            Integer pageSize,
            @ApiParam("状态")
            Integer status
    ){
        PageResponse<NursingProjectVo> pageResult=nursingProjectService.queryPage(name,status,pageNum,pageSize);
        return success(pageResult);
    }

    @ApiOperation("根据编号查询护理项目信息")
    @GetMapping("/{id}")
    public ResponseResult<NursingProjectVo> getById(
            @ApiParam("护理项目的id")
            @PathVariable("id")Integer id
    ){
        NursingProjectVo byId = nursingProjectService.getById(id);
        return success(byId);
    }


}
